#coding=utf-8
#!/usr/bin/env python

'''
range(20)

'''
list_s = list('abcdefabfasdfasdfefg')

'''
#此种方式可以自动调用close方法进行关闭，无需手动关闭
with open('test.txt', 'w+') as f:
	print 'hello world'
'''

# if isinstance(list_s, list):
# 	print 'yeah'

# movies= ['the holy grail', 1975, 'abc & def', 91,['graham', ['tom cruise', 'jack', 'tom', 'jerry' ]]]

'''
def print_lol(the_list):
	for item in the_list:
		if isinstance(item, list):
			print_lol(item)
			print '==='
		else:
			print item
			print "+++"

print_lol(movies)

def print_argv(*argv):
	item1, item2, item3 = argv
	print "item1 %s, item2 %s , item3 %s" % (item1, item2, item3)

print_argv(1,2,3)
'''

'''
#传递多参数
def print_argv(*argv):
	item1, item2 = argv[:2]
	if len(argv) >= 2:
		item1, item2 = argv[:2]
		print item1, item2

print_argv(1,2,3,4,5)
'''

'''
#传递字典
def print_argv(**argv):
	print type(argv)
	for k in argv:
		print k, argv[k]

print_argv(name='dashuai', gender='male')
print_argv(**dictname)
print_argv(*listname)
'''


#默认参数只能接在非默认参数之后
# def test_fun(name='root', welcome):
# 	print "%s, %s" % (welcome, name)

# test_fun(welcome='aaa')
# test_fun(name='dashuai')
# test_fun(name='dashuai', welcome='/home/work')
# test_fun(name='dashuai',welcome='nihaoa')


# 关键参数
# def func(a, b=5, c=10):
# 	print a, b, c

# func(c=50, a=100)
k = [1,2,3,4,5]

def test(kk):
	print map(lambda x: x*3, kk)

test(k)
